﻿<%@ Page Title="Product Images" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Add-ProductImage.aspx.cs" Inherits="Add_ProductImage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <%--from form's button design --%>
    <link href="css/style-metro.css" rel="stylesheet" type="text/css" />
    <%--css for delete confirmation box--%>
    <link href="css/Popup.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:UpdatePanel runat="server" ID="upImages">
        <ContentTemplate>
            <%--<asp:Button runat="server" ID="HiddenButton" Style="display: none;" OnClick="save" />--%>
            <div class="row-fluid">
                <div class="span12">
                    <div class="portlet box green">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-reorder"></i>
                                <asp:Label runat="server" ID="lblHeader" Text="Upload Product Image"></asp:Label></div>
                        </div>
                        <div class="portlet-body form">
                            <div id="divMessage" runat="server" class="generalMessage">
                            </div>
                            <div runat="server" id="div123" style="min-height: 150px; margin-top: 20px;">
                                <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" AllowedFileTypes="jpg,jpeg,png,gif"
                                    MaximumNumberOfFiles="10" OnUploadComplete="File_Upload" Width="60%" />
                            </div>
                            <div>
                            </div>
                            <ul class="thumbnails subthumbPadding">
                                <asp:Repeater runat="server" ID="dlProductImages" OnItemCommand="ItemCommand">
                                    <ItemTemplate>
                                        <li class="span2 lmargin" style="border: 1px solid #ccc; padding: 5px;">
                                            <div>
                                                <p>
                                                    <asp:LinkButton runat="server" ID="lnkDelete" Style="float: right;" OnClientClick="callAlert(this);return false;"
                                                        CommandArgument='<%# Eval("Id") %>' CommandName="Delete" Text="delete">
                                                    </asp:LinkButton>
                                                </p>
                                                <p>
                                                    <img src='<%# Eval("ImageName","./ProductImages/{0}") %>' />
                                                </p>
                                            </div>
                                        </li>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                            <div class="form-actions">
                                <asp:Button runat="server" ID="btnSave" Text="Save" CssClass="btn blue" OnClick="OnSave" />
                                <asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="btn" PostBackUrl="~/Add-Product.aspx" />
                            </div>
                        </div>
                    </div>
                    <!-- END PAGE CONTENT-->
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--confirmation popup--%>
    <script src="js/PopupManager.js" type="text/javascript"></script>
    <script>
        function callAlert(element) {
           

            var $btn = $(element) // Gets clicked button
            //  var hiddenBValue = $btn.prev().val(); // Gets hidden element value

            AlertCust(element, 'Confirmation', 'are you sure want to remove this image?', IconType.information, PromptType.OkCancel, null, null);
        }
       
    </script>
    <br />
</asp:Content>
